Skip to content

fix: allow Bolt's custom MCP connector OAuth redirect URI - #631

Open
AlexLoyola wants to merge 1 commit into
mainfrom
claude/browserless-mcp-bolt-validation-a6be7a
Open

AlexLoyola wants to merge 1 commit into
mainfrom
claude/browserless-mcp-bolt-validation-a6be7a

Conversation

@AlexLoyola

@AlexLoyola AlexLoyola commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Allow Bolt.new's custom MCP connector to complete MCP OAuth against the hosted server. Bolt registers its client with https://bolt.new/mcp/oauth/callback, which the default allowlist doesn't include, so registration fails with invalid_redirect_uri and Bolt shows Connection failed before any sign-in window opens.

This adds that one exact URI to the default allowlist. The matcher and the existing entries are unchanged.

How the failure was found

  • Adding https://mcp.browserless.io/mcp in Bolt as a custom MCP server (HTTP, MCP OAuth) and clicking Connect returns HTTP 500 from Bolt's own /api/mcp/auth/init, with the generic error Failed to start OAuth flow.
  • A direct registration request to https://mcp.browserless.io/oauth/register with redirect_uris: ["https://bolt.new/mcp/oauth/callback"] returns 400 invalid_redirect_uri. The same request with an allowlisted callback returns 201.
  • Bolt registers server-side, so its exact request couldn't be captured. The callback path comes from Bolt's client route list (/mcp/oauth/callback), and https://bolt.new/mcp/oauth/callback resolves on bolt.new while unknown sibling paths return 404.

Test plan

  • npm run lint, and Prettier on the changed files
  • Redirect URI and config specs: 103 passing with the change, 7 failing without it (regression confirmed)
  • Full mocha suite: 2235 passing, 2 pending, 1 failing. The failure is the replay-drift integration test ("installs on SDK drift..."), which checks SDK patch replay and doesn't touch the redirect allowlist.
  • test:security: the picomatch install-hook check in scripts/ci/ failed locally. It checks patch-file integrity, which this change doesn't touch. Left for CI to confirm.
  • Hosted sign-in from Bolt after deploy. Not tested yet, because the change has to be deployed first.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for https://bolt.new/mcp/oauth/callback as an approved OAuth redirect URI. Additional configured redirect patterns continue to be supported.

Bolt.new's custom MCP connector registers with the redirect URI
https://bolt.new/mcp/oauth/callback. The hosted server rejected it with
invalid_redirect_uri, so the connector showed "Connection failed" before
any sign-in window opened. Add that one exact URI to the default
allowlist and cover it with registration, authorization, and lookalike
rejection tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The default OAuth redirect URI allow-list now includes https://bolt.new/mcp/oauth/callback. Tests cover exact matching, lookalike rejection, callback registration, and authorization.

Changes

OAuth callback allowlist

Layer / File(s) Summary
Add and verify Bolt’s callback URL
src/config.ts, test/lib/config.spec.ts, test/lib/oauth-redirect-uri.spec.ts
The default allow-list includes Bolt’s callback URL. Tests check exact acceptance, reject lookalike URLs, and verify registration preserves the callback and authorization redirects to the upstream endpoint.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: xrazik1, artiom, andymrtnzp

Merge Risk: Minimal · up to 143f4

This adds Bolt.new's MCP callback to the default allowed redirect URIs, so Bolt's custom connector can register. The change is narrow, exact-match and covered by tests. No actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: adding Bolt's OAuth redirect URI to the default allowlist so Bolt's custom MCP connector can register. The changeset adds that URI to src/config.ts and adds tests for …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the template's Summary, Related issues, Changes, Test plan, and Checklist structure. The Summary explains the change: adding the exact Bolt callback URI to the default OAuth re…
Full details: Title check

Explanation

The title names the main change: adding Bolt's OAuth redirect URI to the default allowlist so Bolt's custom MCP connector can register. The changeset adds that URI to src/config.ts and adds tests for it. The title is specific and matches the objectives. The 'fix:' prefix follows the conventional-commit style.

Full details: Description check

Explanation

The description follows the template's Summary, Related issues, Changes, Test plan, and Checklist structure. The Summary explains the change: adding the exact Bolt callback URI to the default OAuth redirect allowlist so Bolt's MCP connector can register. The Test plan records lint, Prettier, redirect and config spec results, a full-suite run with one unrelated failure, a failing picomatch security check left for CI, and an untested hosted sign-in. Gaps: the Related issues section is empty, with no issue or PR reference, and the Checklist items are unchecked with no note on CONTRIBUTING.md, the conventional-commit prefix, or documentation updates. The description also does not say whether the change adds new dependencies. These gaps are minor, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the callback gate
The Bolt URL joins the list
Lookalike links are turned away
Registration keeps the path intact
Authorization takes its course
The rabbit hops off, tests complete

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 945f911e-72ac-4b66-a51f-9164d1245ab9
Commits

Reviewing files that changed from the base of the PR and between b2e65be and 143f43c.

Files selected for processing: 3

  • src/config.ts
  • test/lib/config.spec.ts
  • test/lib/oauth-redirect-uri.spec.ts

Included review availability: This review used your included allowance. 9 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.

@AlexLoyola
AlexLoyola marked this pull request as ready for review December 4, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants